//

// (  )
//

package com.tools.acceleratecore.xlib.xlib.impl;

import com.tools.acceleratecore.xlib.xlib.intf.IXObserver;
import java.util.ArrayList;
import java.util.List;

public abstract class XObserver<T> implements IXObserver<T> {
    protected List<T> mListListener = new ArrayList();

    public XObserver() {
    }

    public void addListener(T listener) {
        List var2 = this.mListListener;
        synchronized(this.mListListener) {
            if (!this.mListListener.contains(listener)) {
                this.mListListener.add(listener);
            }

        }
    }

    public void removeListener(T listener) {
        List var2 = this.mListListener;
        synchronized(this.mListListener) {
            if (this.mListListener.contains(listener)) {
                this.mListListener.remove(listener);
            }

        }
    }

    public void removeAllListener() {
        List var1 = this.mListListener;
        synchronized(this.mListListener) {
            this.mListListener.clear();
        }
    }

    protected List<T> getListListener() {
        List var1 = this.mListListener;
        synchronized(this.mListListener) {
            return new ArrayList(this.mListListener);
        }
    }
}
